# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=darkjumper
pkgver=5.8
pkgrel=8
pkgdesc='This tool will try to find every website that host at the same server at your target.'
depends=('perl' 'python2')
url='http://sourceforge.net/projects/darkjumper/'
groups=('blackarch' 'blackarch-webapp')
license=('GPL')
arch=('any')
source=("http://downloads.sourceforge.net/darkjumper/$pkgname.v$pkgver.tar.gz")
sha512sums=('91f412cce641831f3797e659b5f8390f984e61c5736503ab1fc0c8fa06abf5b96d6290a70ab46a30be24c0dd194a8ff6634b3775963d23db7d5449d810bb2374')

prepare(){
  cd "$pkgname.v$pkgver"

  sed -i 's|/usr/bin/python|/usr/bin/env python2|' *.py
  sed -i '/file\.write/d' *.py
}

package() {
  cd "$pkgname.v$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname"

  chmod -x "$pkgdir/usr/share/$pkgname"/*
  chmod +x "$pkgdir/usr/share/$pkgname"/*.{pl,py}
  rm "$pkgdir/usr/share/$pkgname"/*.pyc

  for i in *.pl *.py ; do
    ln -s "/usr/share/$pkgname/$i" "$pkgdir/usr/bin/$i"
  done
}

